import 'package:flutter/material.dart';
import 'package:flutter_jd/pages/tabbar/home/controller.dart';
import 'package:flutter_jd/routes/routing_constants.dart';
import 'package:flutter_jd/ui/widgets/kit.dart';
import 'package:flutter_jd/ui/widgets/search/search_bar.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/route_manager.dart';

// 搜索栏
class HomeTopBar extends GetWidget<HomeController> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: [
          Container(
            height: controller.statusBarHeight.value.h,
          ),
          Container(
            height: controller.searchBarHeight.value,
            padding: EdgeInsets.only(
              left: 12.w,
              right: 12.w,
            ),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                SearchBar(
                  height: 30.h,
                  placeholderText: '机械键盘',
                  background: Colors.white,
                ),
                SizedBox(
                  width: 8.w,
                ),
                Row(
                  children: [
                    GestureDetector(
                      onTap: () {
                        print('扫一扫');
                      },
                      child: Container(
                        margin: EdgeInsets.only(right: 10.w),
                        child: Kit.iconFont(0xe8b6, Colors.white, 22.sp),
                      ),
                    ),
                    GestureDetector(
                      onTap: () {
                        Get.toNamed(MessageRoute);
                      },
                      child: Container(
                        child: Kit.iconFont(0xe8b8, Colors.white, 22.sp),
                      ),
                    ),
                  ],
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}
